home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
ctlib100.zip
/
INSTALL.LZH
/
CTSTACKS.INT
< prev
next >
Wrap
Text File
|
1996-10-12
|
4KB
|
126 lines
{**************************************************************************}
{* BitSoft Development, L.L.C. *}
{* Copyright (C) 1995, 1996 BitSoft Development, L.L.C. *}
{* All rights reserved. *}
{* Stack objects unit *}
{* Version 1.0.9 *}
{**************************************************************************}
unit ctStacks;
{$X+}
interface
uses Objects,
Containr, ctCollec, ctArrays, ctLists, ctTypes;
type
PStreamStack = ^TStreamStack;
TStreamStack = object(TStreamCollection)
function Bottom : Pointer; virtual;
function Pop : Pointer; virtual;
function Push (Item : Pointer) : Boolean; virtual;
function Top : Pointer; virtual;
end; { TStreamStack }
type
PEmsStack = ^TEmsStack;
TEmsStack = object(TStreamStack)
function InitStream(Size : LongInt): PStream; virtual;
end; { TEmsStack }
type
PLinkedStack = ^TLinkedStack;
TLinkedStack = object(TList)
function Bottom : PListNode; virtual;
function Pop : Pointer; virtual;
function Push (Item : Pointer) : Boolean; virtual;
function Top : PListNode; virtual;
end; { TLinkedStack }
type
PCollectionStack = ^TCollectionStack;
TCollectionStack = object(TCollection)
function Bottom : Pointer; virtual;
function Pop : Pointer; virtual;
function Push (Item : Pointer) : Boolean; virtual;
function Top : Pointer; virtual;
end; { TCollectionStack }
type
PHugeCollectionStack = ^THugeCollectionStack;
THugeCollectionStack = object(THugeCollection)
function Bottom : Pointer; virtual;
function Pop : Pointer; virtual;
function Push (Item : Pointer) : Boolean; virtual;
function Top : Pointer; virtual;
end; { THugeCollectionStack }
type
PArrayStack = ^TArrayStack;
TArrayStack = object(TResizableStdArray)
function Bottom : Pointer; virtual;
function Pop : Pointer; virtual;
function Push (Item : Pointer) : Boolean; virtual;
function Top : Pointer; virtual;
end; { TArrayStack }
type
PHugeArrayStack = ^THugeArrayStack;
THugeArrayStack = object(TResizableHugeArray)
function Bottom : Pointer; virtual;
function Pop : Pointer; virtual;
function Push (Item : Pointer) : Boolean; virtual;
function Top : Pointer; virtual;
end; { THugeArrayStack }
procedure RegisterStacks;
const
RCollectionStack : TStreamRec = (
ObjType : idCollectionStack;
VmtLink : Ofs(TypeOf(TCollectionStack)^);
Load : @TCollectionStack.Load;
Store : @TCollectionStack.Store);
RHugeCollectionStack : TStreamRec = (
ObjType : idHugeCollectionStack;
VmtLink : Ofs(TypeOf(THugeCollectionStack)^);
Load : @THugeCollectionStack.Load;
Store : @THugeCollectionStack.Store);
RArrayStack : TStreamRec = (
ObjType : idArrayStack;
VmtLink : Ofs(TypeOf(TArrayStack)^);
Load : @TArrayStack.Load;
Store : @TArrayStack.Store);
RHugeArrayStack : TStreamRec = (
ObjType : idHugeArrayStack;
VmtLink : Ofs(TypeOf(THugeArrayStack)^);
Load : @THugeArrayStack.Load;
Store : @THugeArrayStack.Store);
RLinkedStack : TStreamRec = (
ObjType : idLinkedStack;
VmtLink : Ofs(TypeOf(TLinkedStack)^);
Load : @TLinkedStack.Load;
Store : @TLinkedStack.Store);
RStreamStack : TStreamRec = (
ObjType : idStreamStack;
VmtLink : Ofs(TypeOf(TStreamStack)^);
Load : @TStreamStack.Load;
Store : @TStreamStack.Store);
REmsStack : TStreamRec = (
ObjType : idEmsStack;
VmtLink : Ofs(TypeOf(TEmsStack)^);
Load : @TEmsStack.Load;
Store : @TEmsStack.Store);
implementation
end.